<?php
declare (strict_types=1);

namespace app\job\command;

use app\job\queue\ConsumeQueue;
use app\job\queue\QueueLogic;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\facade\Queue;

class QueueWorkTest extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('queue-work-test')
            ->setDescription('测试消息队列');
    }

    protected function execute(Input $input, Output $output)
    {
        // 指令输出
        $output->writeln('queueWorkTest');

        for ($i = 0; $i < 1; $i++) {
            QueueLogic::creaateQueue("ConsumeQueue", [
                "abc" => $i,
                "date" => date("Y-m-d H:i:s"),
            ],0,"redis");
        }

//        Queue::push(MediaSubAccountConsumeQueue::class, [
//            "abc" => 1,
//            "date" => date("Y-m-d H:i:s"),
//        ], "redis");

    }
}
